#!/bin/bash

echo -e "export OPENBLAS_CORETYPE=ARMV8" >>  ~/.bashrc
echo -e "export PATH=/usr/local/cuda-10.2/bin:$PATH" >> ~/.bashrc
echo -e "export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH" >> ~/.bashrc
echo -e "export CUDA_HOME=/usr/local/cuda-10.2" >> ~/.bashrc

echo -e "export ROS_IP=\`ifconfig wlan0 | grep -w inet | cut -d : -f 2 | awk {'print \$2'}\`" >> ~/.bashrc
echo -e "export ROS_HOSTNAME=\`ifconfig wlan0 | grep -w inet | cut -d : -f 2 | awk {'print \$2'}\`" >> ~/.bashrc
echo -e "#指定本机wlan0获得的IP为ros master" >> ~/.bashrc
echo -e "export ROS_MASTER_URI=http://\`ifconfig wlan0 | grep -w inet | cut -d : -f 2 | awk {'print \$2'}\`:11311" >> ~/.bashrc
echo -e "#指定别的主机做为master，用于多机器人使用" >> ~/.bashrc
echo -e "#export ROS_MASTER_URI=http://192.168.1.107:11311"  >> ~/.bashrc
echo -e "#指定机器人的名字,用于多机器人使用" >> ~/.bashrc
echo -e "#export ROBOT_NAME=riki1"  >> ~/.bashrc

echo -e "\n#摄像头指定,奥比中光、奥比中光pro、奥比中光gemini、USB摄像头、CSI摄像头、intel(D415、D435、D435i)分别设置astra, astrapro,gemini,usb, csi,intel" >> ~/.bashrc
echo -e "export CAMERA=astra" >> ~/.bashrc

echo -e "\n#RIKIBOT系列车型指定，这里会涉及到车体底盘大小及雷达安装位置，" >> ~/.bashrc
echo -e "\n#车型有:麦轮小车x4，移动抓取xarm，服务机器人与X7双臂机器人为同一个底盘xs, 圆形差速机器人底盘为cxs, 无刷四驱UGV底盘fx4,实验箱小车box" >>  ~/.bashrc
echo -e "\n#(x4, xarm, xs, csx, fx4, box)" >>  ~/.bashrc
echo -e "export RIKIMODEL=x4" >>  ~/.bashrc

echo -e "\n#通信方式指定，目前有rosserial目前只支持ROS1，serial可以支持ROS1与ROS2两种通信方式" >> ~/.bashrc
echo -e "export CMM_MODE=rosserial" >> ~/.bashrc

echo -e "\n#车型结构指定，可设置为三种车型，差速、全向、阿克曼（diff, omni, ackm）" >> ~/.bashrc
echo -e "export RIKIBASE=omni" >> ~/.bashrc

echo -e "\n#指定导航算法，有dwa与teb两种导航算法，阿克曼车型一定要为teb算法" >> ~/.bashrc
echo -e "export NAV_PATH=dwa"  >> ~/.bashrc

echo -e "\n#RIKIBOT IMU指定，有驱动板内置mpu6050与外接hfi高精度imu(mpu6050, hfi)" >> ~/.bashrc
echo -e "export RIKIIMU=mpu6050" >> ~/.bashrc

echo -e "\n#雷达型号指定，目前为思岚(rplidar),速腾16线激光雷达(rslidar),镭神激光雷达（lslidar" >> ~/.bashrc
echo -e "export RIKILIDAR=rplidar" >> ~/.bashrc


echo -e "\n#移动抓取的手眼标定，action为执行模式，calibration为校正模式" >> ~/.bashrc
echo -e "export AUTO_ARM_CALIB=action" >>  ~/.bashrc
echo -e "#export AUTO_ARM_CALIB=calibration" >>  ~/.bashrc

echo -e "\n#摄像头的校正，action为执行模式，calibration为校正模式" >> ~/.bashrc
echo -e "#export RIKI_IN_CALIB=calibration" >>  ~/.bashrc
echo -e "export RIKI_IN_CALIB=action" >>   ~/.bashrc


echo -e "\n#全局代理模式，需要通过特殊工具访问外网时用" >> ~/.bashrc
echo -e "#export http_proxy='http://192.168.1.104:8888'" >>  ~/.bashrc
echo -e "#export https_proxy='http://192.168.1.104:8888'" >>  ~/.bashrc
echo -e "#export ftp_proxy='http://192.168.1.104:8888'" >>  ~/.bashrc


echo -e "xrandr --fb 1360x768" >>  ~/.profile

echo "RIKIBOT bashrc config done"
